﻿using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
namespace INTEX.DataBase.Tools
{
    public partial class INTEXDBC
    {
        public DataSet QueryFSEGROE(DataRow dwData, int option = 1)
        {
            DataSet setReturn = new DataSet();
            DataSet Result = new DataSet();
            DataTable tbLocal = null;
            OracleCommand or1 = null;
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM FSEGROE WHERE  ROWNUM<2 ";
                    break;
                case 1:
                    or1 = OracleDB.CreateCommand();
                    or1.CommandText = "SELECT * FROM FSEGROE  "
                    + " WHERE FSEMANDANT=:FSEMANDANT ";
                    or1.Parameters.Add("FSEMANDANT", OracleType.NVarChar).Value = dwData["FSEMANDANT"].ToString();
                    break;
                default:
                    break;
            }

            Result = Connect2Proxy(or1);

            if (Result.Tables.Count > 0)
            {
                tbLocal = Result.Tables[0];
                tbLocal.TableName = "FSEGROE";
            }
            setReturn.Merge(Result);
            return setReturn;
        }
    }
}
